package com.example.dryyzx.dao;

import com.example.dryyzx.entity.NursingLevel;
import org.apache.ibatis.jdbc.SQL;

public class NursingLevelSqlProvider {
    public String insertSelective(NursingLevel record) {
        SQL sql = new SQL();
        sql.INSERT_INTO("nursing_level");
        
        if (record.getId() != null) {
            sql.VALUES("id", "#{id,jdbcType=INTEGER}");
        }
        
        if (record.getLevel() != null) {
            sql.VALUES("level", "#{level,jdbcType=VARCHAR}");
        }
        
        if (record.getEnable() != null) {
            sql.VALUES("enable", "#{enable,jdbcType=BIT}");
        }
        
        if (record.getDescription() != null) {
            sql.VALUES("description", "#{description,jdbcType=VARCHAR}");
        }
        
        if (record.getContentId1() != null) {
            sql.VALUES("content_id1", "#{contentId1,jdbcType=INTEGER}");
        }

        if (record.getFre1() != null) {
            sql.VALUES("fre1", "#{fre1,jdbcType=VARCHAR}");
        }

        if (record.getTime1() != null) {
            sql.VALUES("time1", "#{time1,jdbcType=INTEGER}");
        }

        if (record.getContentId2() != null) {
            sql.VALUES("content_id2", "#{contentId2,jdbcType=INTEGER}");
        }

        if (record.getFre2() != null) {
            sql.VALUES("fre2", "#{fre2,jdbcType=VARCHAR}");
        }

        if (record.getTime2() != null) {
            sql.VALUES("time2", "#{time2,jdbcType=INTEGER}");
        }

        if (record.getContentId3() != null) {
            sql.VALUES("content_id3", "#{contentId3,jdbcType=INTEGER}");
        }

        if (record.getFre3() != null) {
            sql.VALUES("fre3", "#{fre3,jdbcType=VARCHAR}");
        }

        if (record.getTime3() != null) {
            sql.VALUES("time3", "#{time3,jdbcType=INTEGER}");
        }

        if (record.getContentId4() != null) {
            sql.VALUES("content_id4", "#{contentId4,jdbcType=INTEGER}");
        }

        if (record.getFre4() != null) {
            sql.VALUES("fre4", "#{fre4,jdbcType=VARCHAR}");
        }

        if (record.getTime4() != null) {
            sql.VALUES("time4", "#{time4,jdbcType=INTEGER}");
        }

        if (record.getContentId5() != null) {
            sql.VALUES("content_id5", "#{contentId5,jdbcType=INTEGER}");
        }

        if (record.getFre5() != null) {
            sql.VALUES("fre5", "#{fre5,jdbcType=VARCHAR}");
        }

        if (record.getTime5() != null) {
            sql.VALUES("time5", "#{time5,jdbcType=INTEGER}");
        }

        if (record.getContentId6() != null) {
            sql.VALUES("content_id6", "#{contentId6,jdbcType=INTEGER}");
        }

        if (record.getFre6() != null) {
            sql.VALUES("fre6", "#{fre6,jdbcType=VARCHAR}");
        }

        if (record.getTime6() != null) {
            sql.VALUES("time6", "#{time6,jdbcType=INTEGER}");
        }

        return sql.toString();
    }

    public String updateByPrimaryKeySelective(NursingLevel record) {
        SQL sql = new SQL();
        sql.UPDATE("nursing_level");
        
        if (record.getLevel() != null) {
            sql.SET("level = #{level,jdbcType=VARCHAR}");
        }
        
        if (record.getEnable() != null) {
            sql.SET("enable = #{enable,jdbcType=BIT}");
        }
        
        if (record.getDescription() != null) {
            sql.SET("description = #{description,jdbcType=VARCHAR}");
        }

        if (record.getContentId1() != null) {
            sql.SET("content_id1 = #{contentId1,jdbcType=INTEGER}");
        }


        if (record.getFre1() != null) {
            sql.SET("fre1 = #{fre1,jdbcType=VARCHAR}");
        }

        if (record.getTime1() != null) {
            sql.SET("time1 = #{time1,jdbcType=INTEGER}");
        }

        if (record.getContentId2() != null) {
            sql.SET("content_id2 = #{contentId2,jdbcType=INTEGER}");
        }

        if (record.getFre2() != null) {
            sql.SET("fre2 = #{fre2,jdbcType=VARCHAR}");
        }

        if (record.getTime2() != null) {
            sql.SET("time2 = #{time2,jdbcType=INTEGER}");
        }

        if (record.getContentId3() != null) {
            sql.SET("content_id3 = #{contentId3,jdbcType=INTEGER}");
        }

        if (record.getFre3() != null) {
            sql.SET("fre3 = #{fre3,jdbcType=VARCHAR}");
        }

        if (record.getTime3() != null) {
            sql.SET("time3 = #{time3,jdbcType=INTEGER}");
        }

        if (record.getContentId4() != null) {
            sql.SET("content_id4 = #{contentId4,jdbcType=INTEGER}");
        }

        if (record.getFre4() != null) {
            sql.SET("fre4 = #{fre4,jdbcType=VARCHAR}");
        }

        if (record.getTime4() != null) {
            sql.SET("time4 = #{time4,jdbcType=INTEGER}");
        }

        if (record.getContentId5() != null) {
            sql.SET("content_id5 = #{contentId5,jdbcType=INTEGER}");
        }

        if (record.getFre5() != null) {
            sql.SET("fre5 = #{fre5,jdbcType=VARCHAR}");
        }

        if (record.getTime5() != null) {
            sql.SET("time5 = #{time5,jdbcType=INTEGER}");
        }

        if (record.getContentId6() != null) {
            sql.SET("content_id6 = #{contentId6,jdbcType=INTEGER}");
        }

        if (record.getFre6() != null) {
            sql.SET("fre6 = #{fre6,jdbcType=VARCHAR}");
        }

        if (record.getTime6() != null) {
            sql.SET("time6 = #{time6,jdbcType=INTEGER}");
        }

        sql.WHERE("id = #{id,jdbcType=INTEGER}");
        
        return sql.toString();
    }

    public String setNull1(NursingLevel record) {
        SQL sql = new SQL();
        sql.UPDATE("nursing_level");

        sql.SET("content_id1 = null");

        sql.SET("fre1 = null");

        sql.SET("time1 = null");

        sql.WHERE("id = #{id,jdbcType=INTEGER}");

        return sql.toString();
    }

    public String setNull2(NursingLevel record) {
        SQL sql = new SQL();
        sql.UPDATE("nursing_level");

        sql.SET("content_id2 = null");

        sql.SET("fre2 = null");

        sql.SET("time2 = null");

        sql.WHERE("id = #{id,jdbcType=INTEGER}");

        return sql.toString();
    }

    public String setNull3(NursingLevel record) {
        SQL sql = new SQL();
        sql.UPDATE("nursing_level");

        sql.SET("content_id3 = null");

        sql.SET("fre3 = null");

        sql.SET("time3 = null");

        sql.WHERE("id = #{id,jdbcType=INTEGER}");

        return sql.toString();
    }

    public String setNull4(NursingLevel record) {
        SQL sql = new SQL();
        sql.UPDATE("nursing_level");

        sql.SET("content_id4 = null");

        sql.SET("fre4 = null");

        sql.SET("time4 = null");

        sql.WHERE("id = #{id,jdbcType=INTEGER}");

        return sql.toString();
    }

    public String setNull5(NursingLevel record) {
        SQL sql = new SQL();
        sql.UPDATE("nursing_level");

        sql.SET("content_id5 = null");

        sql.SET("fre5 = null");

        sql.SET("time5 = null");

        sql.WHERE("id = #{id,jdbcType=INTEGER}");

        return sql.toString();
    }

    public String setNull6(NursingLevel record) {
        SQL sql = new SQL();
        sql.UPDATE("nursing_level");

        sql.SET("content_id6 = null");

        sql.SET("fre6 = null");

        sql.SET("time6 = null");

        sql.WHERE("id = #{id,jdbcType=INTEGER}");
        
        return sql.toString();
    }
}